BeSly Software Solutions About yab Demos About us Admin






Name:

repeat -- start a repeat-loop

Synopsis:
 
repeat 
  ... 
until (...) 

Description:
The repeat-loop executes all the statements up to the final until-keyword over and over. The loop is executed as long as the condition, which is specified with the until-clause, becomes true. By construction, the statements within the loop are executed at least once.

Example:
//*** requires ncurses support compiled in ***
//See Documentation/Advanced for info.
x=0 
clear screen 
print "This program will print the numbers from 1 to 10" 
repeat 
	x=x+1 
	print x 
	print "Press any key for the next number, or 'q' to quit" 
	if (inkey$="q") break 
until(x=10) 
Explanation:

This program is pretty much useless, but self-explanatory.



Related: until, break, while, do